#ifndef _UTIL_CURL_CLIENT_
#define _UTIL_CURL_CLIENT_

#include <string>

namespace base {

// thread-safe, singleton libcrul client wrapper
class CurlClient {
public:
  ~CurlClient() {}

  static CurlClient & Instance() {
    static CurlClient instance;
    return instance;
  } 
  int Get(const std::string & url, std::string * response);
  int Post(const std::string & url, const std::string & post_body, std::string * response);
private:
  CurlClient();
  enum HttpMethod {
    HTTP_GET,
    HTTP_POST
  };
  int DoRequest(const std::string & url, HttpMethod method, const std::string & post_body, std::string * response);
};

}

#endif // _UTIL_CURL_CLIENT_

